from itertools import combinations


def set_models(model, params):
    if len(params) == 0:
        return model()
    else:
        return model(**params)


def print_dict(dt: dict, ver=False):
    if ver:
        names = list(dt.keys())
        for name in names:
            print("{:4s}\t".format(name), end="")
        print("")

    for key in dt:
        if not ver:
            print("{:4s}:".format(key), end="")

        v = dt[key]
        if not isinstance(v, str):
            v = "{:.4f}".format(v)

        print("{:4s}\t".format(v), end="")

    print("")
    print("*" * 50)


def get_combination(lst: list):
    lens = len(lst)
    for k in range(1, lens + 1):
        yield combinations(lst, k)
